package com.test.config;

import com.test.factory.MyFactoryBean;
import com.test.register.MyBeanDefineationRegister;
import com.test.beanimport.MyImportSelector;
import com.test.pojo.Green;
import com.test.pojo.Red;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

/**
 * @Aurher: QiaoHang
 * @Description:
 * @Data: 2019/9/13 9:58
 * @Modified By:
 */
@Configuration
@Import(value = {Green.class, BeanConfig.class,MyImportSelector.class, MyBeanDefineationRegister.class})     // 通过importBeanDefinitionRegistory  ---> rainbow 生效
//@Import(value = { MyImportSelector.class, MyBeanDefineationRegister.class})
public class ImportConfigAdvance {

    @Bean(name = "red")
    public Red initRed(){
        return new Red();
    }

    @Bean
    public MyFactoryBean factoryBean(){
        return new MyFactoryBean();
    }
}
